nums = list(map(int,input().split()))
target = int(input())
print(nums)
for i in range(len(nums)):
    for j in range(i + 1, len(nums)):
        if nums[i] + nums[j] == target:
            print(i,j)


# nuns = [1,2,3,4,5,9]
# taget = 3
# for i in range(0,5):
#     for j in range(i+1,5):
#         if nuns[i] + nuns[j] == taget:
#             print(i)
#             print(j)